<template>
  <el-scrollbar>
    <div class="content">
      <el-card class="" style="width: 100%; height: 100%; margin-top: 20px">
        <div v-for="(item, index) in this.tenComments" :key="index">
          <el-link @click="GetArticeFromId(item.id)" target="_blank" style=""
            >{{ index + 1 }}.{{ item.title }}</el-link
          >
        </div>
      </el-card>
    </div>
  </el-scrollbar>
</template>

<script>
// import navbar from '../components/Layout.vue'
import { GetCommentTopten } from "../api/articles";
export default {
  data() {
    return {
      tenComments: [],
    };
  },
  methods: {
    GetArticeFromId(id) {
      this.$router.push(`/Article?id=${id}`);
    },
  },
  mounted() {
    GetCommentTopten().then(({ data }) => {
      console.log(data);
      this.tenComments = data.data;
      // console.log(this.tenComments);
    });
  },
};
</script>

<style>
/* .el-scollbar > .x{
  min-width:100%;
    display: inline-block;
} */
.el-scrollbar .el-scrollbar__wrap {
  max-height: 836px;
  overflow-x: hidden;
}
</style>